package com.google.zxing.preview;

import android.content.Context;
import android.support.annotation.ColorInt;
import android.util.AttributeSet;
import android.view.WindowManager;

import com.focusai.efairy.R;


public class QrCodeForegroundPreview extends QrCodeForegroundView {
    private Context context;
	public QrCodeForegroundPreview(Context context, AttributeSet attrs) {
		super(context, attrs);
        this.context=context;
	}

	@Override
	protected @ColorInt int getMaskColor() {
		// TODO Auto-generated method stub
		return resources.getColor(R.color.zxing_preview_bg);
	}

	@Override
	protected @ColorInt int getResultColor() {
		// TODO Auto-generated method stub
		return resources.getColor(R.color.result_view);
	}

	@Override
	protected int getFrameLineColor() {
		// TODO Auto-generated method stub
		return resources.getColor(R.color.primary_light_fc6);
	}

	@Override
	protected int getPointColor() {
		// TODO Auto-generated method stub
		return  resources.getColor(R.color.possible_result_points);
	}

	@Override
	protected int getCornerWidth() {
		// TODO Auto-generated method stub
		return 1;
	}

	@Override
	protected long getInvaliteTime() {
		return 20L;
	}

    @Override
	protected String getScanType() {
		// TODO Auto-generated method stub
		return "zxing";
	}

    @Override
	protected int getOpaque() {
		// TODO Auto-generated method stub
		return 0xFF;
	}

	@Override
	protected boolean isSupportResultPoint() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	protected int getScanTextColor() {
		// TODO Auto-generated method stub
		return getResources().getColor(R.color.primary_light_fc6);
	}

    @Override
    protected String  getScanText() {
        return resources.getString(R.string.scan_tip);
    }

    @Override
    protected int getScanTextLeft() {
            return ((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/2;
    }

    @Override
    protected int getScanTextSize() {
        return (int)resources.getDimension(R.dimen.common_font_fs4);
    }

}
